/********************************************************************************
 * @Author: Zhenzhou Liu
 * @Date: 2025-02-07
 * @Description: 
 *******************************************************************************/
#include <iostream>
#include <stack>

using namespace std;

void stackSort(stack<int> & sta) {
    stack<int> help;
    while (!sta.empty())
    {
        int cur = sta.top();
        sta.pop();

        while (!help.empty() && help.top() < cur)
        {
            sta.push(help.top());
            help.pop();
        }
        help.push(cur);
    }

    while (!help.empty()) {
        sta.push(help.top());
        help.pop();
    }
}

int main() {
    int n;
    cin >> n;
    stack<int> sta;
    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        sta.push(x);
    }
    stackSort(sta);
    for (int i = 0; i < n; i++) {
        if (i > 0)
            cout << " ";
        cout << sta.top();
        sta.pop();
    }
}
